<template>
  <div>
    <div class="person-background"></div>
    <el-container style="width:80%;margin:0 auto;margin-top:-80px;">
      <el-aside width="300px;">
        <PersonSide></PersonSide>
      </el-aside>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </div>
</template>

<script>
import {
    getInfo,getListFans,getListAttention
  } from '@/api/accountApi.js';

  import PersonSide from './util/PersonSide'
  export default {
    name: 'PersonIndex',
    components: {
      PersonSide
    },
    created() { 
      getInfo(this.$store.state.user.userId).then(resp => {
        getListAttention(resp.data.infoId).then(resp => {
          this.$store.commit('setUserAttention',resp.data);
        })
        getListFans(resp.data.infoId).then(resp => {
          this.$store.commit('setUserFans',resp.data);
        })
      })
    },
  }
</script>

<style>
  .person-background {
    width: 100%;
    margin: 0 auto;
    background: url("../../assets/person-bj.jpg") no-repeat;
    background-position: center;
    height: 260px;
    background-size: cover;
  }
</style>